package po.message;
/**
 * @author 陈赞宇
 * 消息类
 */

import java.time.LocalDateTime;

import po.emp.Department;
import po.emp.Empoyee;

public class Message {
	private int msgId;
	private String msgTitle;  //标题
	private Empoyee sendEmp;  //发信息人
	private LocalDateTime sendTime; //发送时间
	private String content;     // 发送内容
	private Department depart;  // 发送部门
	private boolean deleteFlag;
	public Message() {
		super();
	}
	public Message(int msgId, String msgTitle, Empoyee sendEmp, LocalDateTime sendTime, String content,
			Department depart, boolean deleteFlag) {
		super();
		this.msgId = msgId;
		this.msgTitle = msgTitle;
		this.sendEmp = sendEmp;
		this.sendTime = sendTime;
		this.content = content;
		this.depart = depart;
		this.deleteFlag = deleteFlag;
	}
	public int getMsgId() {
		return msgId;
	}
	public void setMsgId(int msgId) {
		this.msgId = msgId;
	}
	public String getMsgTitle() {
		return msgTitle;
	}
	public void setMsgTitle(String msgTitle) {
		this.msgTitle = msgTitle;
	}
	public Empoyee getSendEmp() {
		return sendEmp;
	}
	public void setSendEmp(Empoyee sendEmp) {
		this.sendEmp = sendEmp;
	}
	public LocalDateTime getSendTime() {
		return sendTime;
	}
	public void setSendTime(LocalDateTime sendTime) {
		this.sendTime = sendTime;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public Department getDepart() {
		return depart;
	}
	public void setDepart(Department depart) {
		this.depart = depart;
	}
	public boolean isDeleteFlag() {
		return deleteFlag;
	}
	public void setDeleteFlag(boolean deleteFlag) {
		this.deleteFlag = deleteFlag;
	}
	@Override
	public String toString() {
		return "Message [msgId=" + msgId + ", msgTitle=" + msgTitle + ", sendEmp=" + sendEmp + ", sendTime=" + sendTime
				+ ", content=" + content + ", depart=" + depart + ", deleteFlag=" + deleteFlag + "]";
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + msgId;
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Message other = (Message) obj;
		if (msgId != other.msgId)
			return false;
		return true;
	}
	
	
}
